<?php 
session_start();
$vid = $_GET['vid'];
if(empty($_GET['vid'])){
	header('location:index.php');
}
$index = empty($_GET['index'])?1:$_GET['index'];
?>
<?php
	if($_POST['data']){
		$data = json_decode(base64_decode($_POST['data']),true);
		$_SESSION['USER'] = $data;
	}
	if(empty($_SESSION['USER'])){
		$callbackUrl = 'http://api.weixinzjit.com/lb/share.php?vid='.$vid.'&index='.$index;
		$oauthUrl = 'http://api.weixinzjit.com/api.php/wx/oauth?callback='.urlencode($callbackUrl).'&type=userinfo'; 
		echo '<script>location.href="'.$oauthUrl.'"</script>';
		exit();
	}
?>

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title>立邦祝福</title>
		<link rel="stylesheet" type="text/css" href="css/share.css">
		<script type="text/javascript" src="js/jquery.min.js"></script> 
		<script src="js/adaptUILayout.js"></script> 
	    <script>
	        adaptUILayout.load(640);
	    </script>
	</head>
<body d_type="<?php echo $index;?>">
		<div id="loading">
			<img src="img/loading.png"  />
			<span id="per"></span>
		</div>
	<div class="bg"></div>
	<div id="snow">
		<div class="sn sn1"></div>
		<div class="sn sn2"></div>
		<div class="sn sn3"></div>
		<div class="sn sn4"></div>
	</div>
	<!--
	<div class="p5_mv">
		<div class="p5mv p5mv_1 mv"></div>
		<div class="p5mv p5mv_2"></div>
		<div class="p5mv p5mv_3"></div>
		<div class="p5mv p5mv_4"></div>
	</div>
	-->
	<div class="page_view">
		<div class="box_back"></div>
		<div class="card"></div>
		<div class="box_front"></div>
		<div class="hz">
			<div class="hz_body"></div>
			<div class="hz_head"></div>
		</div>
		<div class="p5_bg_2"></div>
		<div class="listionBtn"></div>
	</div>
	
	<div class="page_set">
							<div class="p5_bg"></div>
							<div class="p5_bg_2"></div>
							<div class="p5_star"></div>
							<div class="p5_mv">
								<div class="p5mv p5mv_1 mv"></div>
								<div class="p5mv p5mv_2"></div>
								<div class="p5mv p5mv_3"></div>
								<div class="p5mv p5mv_4"></div>
							</div>
							<div class="p5_txt"></div>
							<div class="p5_tree p5_tree_<?php echo $index; ?>"></div>
							<div class="play_btn"></div>
							<div class="play_txt"></div>
							<div class="p5_btnbox">
								<div class="p5_btn"></div>
							</div>
						</div>
</body>
<script language="JavaScript">
var voice = {
    localId: '',
    serverId: '<?php echo $vid; ?>'
};
</script>
<script language="JavaScript" src="js/share.js"></script>
<?php include_once 'wx_share_js.php'; ?>
</html>